/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.PracticeRecordBO;
import com.xy.biz.ts.domain.query.PracticeRecordQuery;
import com.xy.biz.ts.domain.converter.PracticeRecordConverter;
import com.xy.biz.ts.manager.PracticeRecordManager;
import com.xy.biz.ts.dao.PracticeRecordDao;

/**
 *
 *
 * @author wwj
 * @date 2021-4-7
 */
@Service
public class PracticeRecordManagerImpl implements PracticeRecordManager {

	@Autowired
	private PracticeRecordDao practiceRecordDao;

	@Override
	public int savePracticeRecord(PracticeRecordBO practiceRecordBO) {
		return practiceRecordDao.savePracticeRecord(PracticeRecordConverter.toPO(practiceRecordBO));
	}

	@Override
	public int saveAllPracticeRecord(Collection<PracticeRecordBO> collection) {
		return practiceRecordDao.saveAllPracticeRecord(PracticeRecordConverter.toPO(collection));
	}

	@Override
	public int updatePracticeRecord(PracticeRecordBO practiceRecordBO) {
		return practiceRecordDao.updatePracticeRecord(PracticeRecordConverter.toPO(practiceRecordBO));
	}

	@Override
	public int deletePracticeRecord(Long practiceRecordId) {
		return practiceRecordDao.deletePracticeRecord(practiceRecordId);
	}

	@Override
	public PracticeRecordBO getPracticeRecord(Long practiceRecordId) {
		return PracticeRecordConverter.fromPO(practiceRecordDao.getPracticeRecord(practiceRecordId));
	}

	@Override
	public List<PracticeRecordBO> listPracticeRecordById(Collection<Long> collection) {
		return PracticeRecordConverter.fromPO(practiceRecordDao.listPracticeRecordById(collection));
	}

	@Override
	public List<PracticeRecordBO> listPracticeRecord(PracticeRecordQuery query) {
		return PracticeRecordConverter.fromPO(practiceRecordDao.listPracticeRecord(query));
	}

	@Override
	public int countPracticeRecord(PracticeRecordQuery query) {
		return practiceRecordDao.countPracticeRecord(query);
	}

}
